<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script language="JavaScript" type="text/javascript" src="jquery-1.4.2.min.js" ></script>
	<script type="text/javascript">
		var cache;
		$(document).ready(function () {
			cache = $('<div>').text('cache');
			$('#test1').click(function(){
				$('#d1').append(cache);
			});

			$('#test2').click(function(){
				$('#d2').append(cache);
			});

			$('#test3').click(function(){
				cache.text(new Date().toGMTString());
			});
		});
	</script>

	<title>JS</title>
</head>
<body>
	1:<div id="d1"></div>
	2:<div id="d2"></div>
	<input id="test1" type="button" value="add1" />
	<input id="test2" type="button" value="add2" />
	<input id="test3" type="button" value="change" />
</body>
</html>